package com.stlm2.dems.entity.base;

import com.stlm2.dems.entity.RefundReason;
import com.stlm2.dems.entity.RefundState;
import com.stlm2.dems.entity.RefundType;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by apple on 2017.11.09.
 */
public class BaseRefundLog {

    /**
     * 唯一标识
     */
    private Integer id;

    /**
     * 订单编号
     */
    private String code;
    /**
     * 关联仓库（店铺）订单编号
     */
    private String referCode;
    /**
     * 仓库（店铺）订单ID
     */
    private Integer shopOrderId;

    /**
     * 子订单ID
     */
    private Integer  goodsOrderId;

    /**
     * 用户ID
     */
    private Integer userId;

    /**
     * 退款类型
     */
    private RefundType refundType;

    /**
     * 退款状态
     */
    private RefundState refundState;

    /**
     * 退款原因
     */
    private RefundReason refundReason;

    /**
     * 退换原因
     */
    private String refundExplain;

    /**
     * 总的商品金额
     */
    private BigDecimal totalMoney;

    /**
     * 商品数量
     */
    private Integer num;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 处理时间
     */
    private Date handleTime;
    /**
     * 处理人员ID
     */
    private Integer handleUserId;

    /**
     * 图片
     */
    private String picture;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getReferCode() {
        return referCode;
    }

    public void setReferCode(String referCode) {
        this.referCode = referCode;
    }

    public Integer getShopOrderId() {
        return shopOrderId;
    }

    public void setShopOrderId(Integer shopOrderId) {
        this.shopOrderId = shopOrderId;
    }

    public Integer getGoodsOrderId() {
        return goodsOrderId;
    }

    public void setGoodsOrderId(Integer goodsOrderId) {
        this.goodsOrderId = goodsOrderId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public RefundType getRefundType() {
        return refundType;
    }

    public void setRefundType(RefundType refundType) {
        this.refundType = refundType;
    }

    public RefundState getRefundState() {
        return refundState;
    }

    public void setRefundState(RefundState refundState) {
        this.refundState = refundState;
    }

    public RefundReason getRefundReason() {
        return refundReason;
    }

    public void setRefundReason(RefundReason refundReason) {
        this.refundReason = refundReason;
    }

    public String getRefundExplain() {
        return refundExplain;
    }

    public void setRefundExplain(String refundExplain) {
        this.refundExplain = refundExplain;
    }

    public BigDecimal getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(BigDecimal totalMoney) {
        this.totalMoney = totalMoney;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getHandleTime() {
        return handleTime;
    }

    public void setHandleTime(Date handleTime) {
        this.handleTime = handleTime;
    }

    public Integer getHandleUserId() {
        return handleUserId;
    }

    public void setHandleUserId(Integer handleUserId) {
        this.handleUserId = handleUserId;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    /**
     * 映射
     * @return
     */

    public Integer getRefundTypeValue() {
        return refundType != null ? refundType.getIntValue() : null;
    }

    public void setRefundTypeValue (Integer value) {
        if (value != null)
            refundType = RefundType.getByIntValue(value);
    }

    public Integer getRefundStateValue() {
        return refundState != null ? refundState.getIntValue() : null;
    }

    public void setRefundStateValue (Integer value) {
        if (value != null)
            refundState = RefundState.getByIntValue(value);
    }

    public Integer getRefundReasonValue() {
        return refundReason != null ? refundReason.getIntValue() : null;
    }

    public void setRefundReasonValue (Integer value) {
        if (value != null)
            refundReason = RefundReason.getByIntValue(value);
    }

}
